﻿<Controls:SinacorWindow
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" 
    xmlns:Controls="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient;assembly=Sinacor.Infra.UI.Controls"
    xmlns:Validation="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient.Validation;assembly=Sinacor.Infra.UI.Controls"
    xmlns:Edit="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient.Edit;assembly=Sinacor.Infra.UI.Controls"
    x:Class="Sinacor.UI.Bovespa.Ordens.View.SmartClient.PesquisaTitulo"
	  Title="{DynamicResource Bovespa.Titulo.Label.PesquisaTitulos}"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    ModuleId = "ORD"
    ModulePlus="False"
    WindowStartupLocation="CenterScreen"
    WindowState="Maximized">

    <Controls:SinacorExpanderContainer x:Name="PesquisaTitulos">

        <!--Definição de linhas no Container-->
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <!--Filtros de Pesquisa-->
        <Controls:SinacorExpander x:Name="exp1" Grid.Row ="0" Header="{DynamicResource Bovespa.Titulo.Label.Pesquisa}" IsExpanded="True">
            <Grid>
                <Controls:SinacorLabel x:Name = "labelNomeEmpresa" Content="{DynamicResource Bovespa.Titulo.Label.NomeEmpresa}" Width="100" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="-10,0,0,0" />
                <Controls:SinacorTextBox x:Name ="textNomeEmpresa" ToolTip="" Text = "" Width="211" MaxLength="30" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="94,0,0,0" TabIndex="1" />
                <Controls:SinacorLabel x:Name = "labelMercado" Content="{DynamicResource Bovespa.Titulo.Label.Mercado}" Width="52" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="309,0,0,0"/>
                <Controls:SinacorComboBox x:Name = "comboMercado" Width="138" FontSize="11" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="365,0,0,0" IsTabStop="True" TabIndex="2"/>
                <Controls:SinacorLabel x:Name = "labelCodigoNegociacao" Content="{DynamicResource Bovespa.Titulo.Label.CodigoNegociacao}" Width="105" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="507,0,0,0"/>
                <Controls:SinacorTextBox x:Name ="textCodigoNegociacao" ToolTip=""  Text = "" Width="95" MaxLength="12" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="616,0,0,0" TabIndex="3" />
                <Controls:SinacorLabel x:Name = "labelCodigoISIN" Content="{DynamicResource Bovespa.Titulo.Label.CodigoISIN}" Width="72" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="715,0,0,0"/>
                <Controls:SinacorFilteredTextBox  x:Name ="textCodigoISIN" ToolTip=""  Text =""  VerticalAlignment="Top" HorizontalAlignment="Left" FilterExpression="^[a-zA-Z0-9]{0,12}$"  Margin="791,0,0,0" TabIndex="4" />
                <Controls:SinacorButton x:Name ="BtnPesquisar" Content = "{DynamicResource Bovespa.Titulo.Label.Pesquisar}" CausesValidation="True" Click="Pesquisar_Click" FontSize="11" IsDefault = "True" HorizontalAlignment="Left" Width="75" VerticalAlignment="Top" ClearServiceErrors="True" d:LayoutOverrides="Height" Margin="895,0,0,0" TabIndex="5"/>
            </Grid>
        </Controls:SinacorExpander>

        <!--Grid de Títulos-->
        <Controls:SinacorExpander x:Name="exp2" Grid.Row ="1" Header="{DynamicResource Bovespa.Titulo.Label.Titulos}" IsExpanded="True" AllowExpand="False" Margin="0,4,0,0">
            <Grid>

                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>

                <Controls:SinacorDataGrid x:Name="datagridDados" AllowDelete="False" Grid.Row="0">
                    <!--Menu de Contexto-->
                    <Controls:SinacorDataGrid.ContextMenuTemplate>
                        <DataTemplate>
                            <StackPanel >
                                <Controls:SinacorContextMenuItem x:Name="ctxMnuAceitar" Header="{DynamicResource Bovespa.Titulo.Label.Aceitar}" Click="Aceitar_Click" IsEnabled="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:SinacorWindow}}, Path=IsEnableAceitar}" />
                            </StackPanel>
                        </DataTemplate>
                    </Controls:SinacorDataGrid.ContextMenuTemplate>

                    <!--Colunas da Grid de Títulos-->
                    <Controls:SinacorDataGrid.Columns>
                        <Controls:Column Name="Codigo" DisplayMemberPath="Codigo" Title="Bovespa.Titulo.Label.Codigo" HorizontalCellAlignment="Left" AllowInsert="False" AllowUpdate="False"/>
                        <Controls:Column Name="Isin" DisplayMemberPath="Isin" Title="Bovespa.Titulo.Label.ISIN" HorizontalCellAlignment="Left" AllowInsert="False" AllowUpdate="False" />
                        <Controls:Column Name="Mercado" DisplayMemberPath="Mercado" Title="Bovespa.Titulo.Label.Mercado" HorizontalCellAlignment="Left" AllowInsert="False" AllowUpdate="False" />
                        <Controls:Column Name="Distribuicao" DisplayMemberPath="Distribuicao" Title="Bovespa.Titulo.Label.Distribuicao" HorizontalCellAlignment="Right" AllowInsert="False" AllowUpdate="False" />
                        <Controls:Column Name="Empresa" DisplayMemberPath="Empresa" Title="Bovespa.Titulo.Label.NomeEmpresa" HorizontalCellAlignment="Left" AllowInsert="False" AllowUpdate="False" />
                        <Controls:Column Name="Especificacao" DisplayMemberPath="Especificacao" Title="Bovespa.Titulo.Label.Especie" HorizontalCellAlignment="Left" AllowInsert="False" AllowUpdate="False"  />
                        <Controls:Column Name="PrecoExercido" DisplayMemberPath="PrecoExercido" Title="Bovespa.Titulo.Label.PrecoExercido" HorizontalCellAlignment="Right" AllowInsert="False" AllowUpdate="False" Integers="11" Decimals="6" StringFormat="N6"/>
                    </Controls:SinacorDataGrid.Columns>
                </Controls:SinacorDataGrid>

            </Grid>
        </Controls:SinacorExpander>

    </Controls:SinacorExpanderContainer>

</Controls:SinacorWindow>
